<?php

$out = array();
$line = "";
$subject = "abcdef";
$pattern = '/\S\S\S\S\S\S/';
echo preg_match($pattern, $subject) . "<br>";
$subject = "Hello, 1st World!";
$pattern = '/\d/';
echo preg_match_all($pattern, $subject, $out) . "<br>";
$subject = "Hello, 1st World!";
$pattern = '/\d\S\S\s/';
$replacement = "";
echo preg_replace($pattern, $replacement, $subject) . "<br>";
echo preg_replace_callback('/[A-Za-z]/', create_function('$matches', 'return strtoupper($matches[0]);'), $subject);
?>
